﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using WCFMINERP.Contracts.DataContracts;

namespace WCFMINERP.Factory.Report
{
    public partial class XtraReportProduct2 : DevExpress.XtraReports.UI.XtraReport
    {
        public XtraReportProduct2()
        {
            InitializeComponent();
        }

        public OrderInfo _OrderModel = null;

        public XtraReportProduct2(OrderInfo OrderModel)
        {
            _OrderModel = OrderModel;
            InitializeComponent();

            lbl_ProductCode.Text = "*" + _OrderModel.OrderProductCode + "*";
            lbl_Code.Text = _OrderModel.OrderProductCode;
            lbl_ShopName.Text = _OrderModel.orderBagInfo.ShopName;

         
            if (_OrderModel.CtmName.Length >30)
            {
                lbl_CtmName.Text = _OrderModel.CtmName.Substring(0, 30);
            }
            else
            {
                lbl_CtmName.Text = _OrderModel.CtmName;
            }

            if (_OrderModel.OrderProductName.Length >30)
            {
                lbl_ProductName.Text = _OrderModel.OrderProductName.Substring(0, 30);
            }
            else
            {
                lbl_ProductName.Text = _OrderModel.OrderProductName;
            }
            lbl_dateTime.Text = _OrderModel.FacthTime.ToString("yyyy-MM-dd");
            lbl_P.Text = _OrderModel.photoCount.ToString() + "P";

          
        }
    }
}
